import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
 import {saveStore} from '@/utils/util'
// 用来存储数据
const state = {
   loading:false,
   title:""
}
// 操作数据
const mutations = {
    setLoading(state, payload) {
        state.loading = payload;
        saveStore()
    },
    setTitle(state, payload) {
        state.title = payload;
        saveStore()
    },
}
// 新建并暴露store
export default {
    namespaced:true,
    state,
    mutations,
}
 